package com.groupscore.score.dao;

import com.groupscore.score.pojo.UserException;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface UserExceptionDao extends JpaRepository<UserException, Integer>, JpaSpecificationExecutor<UserException> {

    /**
     * 根据用户id查询异常列表
     * @return
     */
    public List<UserException> findAllByUserId(String UserId);

    public UserException findById(String id);

    @Query(value = "select * from user_exception order by create_time desc",nativeQuery = true)
    public List<UserException> findAllOrOrderByCreateTime();
}
